from thirdparty import juhe

from utils.appresponse import CommonResponseMixin, ReturnCode
from django.http import JsonResponse


constellations = ['白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座', '水瓶座', '双鱼座']


# 星座运势接口
def constellation(request):
    data = []
    for c in constellations:
        result = juhe.constellation(c)
        data.append(result)
    response = CommonResponseMixin.wrap_json_response(data=data, code=ReturnCode.SUCCESS)
    return JsonResponse(data=response, safe=False)

